[C#] refactor: return AdaptiveCardInvokeResponse for ActionExecute - #673
Merged
Merged
Conversation
Kuojian Lu (kuojianlu)
requested a review
from Kavin (singhk97)
as a code owner
October 12, 2023 12:19
| } | ||
|
|
||
| AdaptiveCard adaptiveCard = await handler(turnContext, turnState, invokeValue.Action.Data, cancellationToken); | ||
| AdaptiveCardInvokeResponse adaptiveCardInvokeResponse = new() |
Contributor
There was a problem hiding this comment.
Would it be better if providing something like AdaptiveCardInvokeResponseBuilder.FromCard?
Contributor
Author
There was a problem hiding this comment.
Sure, but let me add it in separate PR.
Qianhao Dong (swatDong)
approved these changes
Oct 13, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issues
closes: #601
Details
Change details
AdaptiveCardInvokeResponseas return type ofActionExecuteHandler. The change is because the original style cannot meet the following requirement: return values with different types in one handler. For example, if I'd like to return Adaptive Card or text message by some cases inOnActionExecute("verb"), I have to defineOnActionExecute("verb", ActionExecuteAdaptiveCardHandler)andOnActionExecute("verb", ActionExecuteTextHandler)respectively. Although the two handlers will be hit, only one result will be returned. A concrete example isSubmitActionin gptME sample.Attestation Checklist
My code follows the style guidelines of this project
I have checked for/fixed spelling, linting, and other errors
I have commented my code for clarity
I have made corresponding changes to the documentation (we use TypeDoc to document our code)
My changes generate no new warnings
I have added tests that validates my changes, and provides sufficient test coverage. I have tested with:
New and existing unit tests pass locally with my changes
Additional information